package cn.keniykey.mc.landterritory.landview;

import java.util.List;

import javax.annotation.Nullable;

import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;

import cn.keniykey.mc.landterritory.LandTerritoryMain;
import cn.keniykey.mc.landterritory.config.ViewsConfiguration;
import cn.keniykey.mc.viewlibrary.view.api.template.AbInputView;

public final class LandInputView extends AbInputView{
	private static final String VIEW_NAME = "input";

	protected LandInputView(Player player1) {
		super(LandTerritoryMain.getPlugin(), player1);
	}

	@Override
	protected ItemStack onDeafultIconOfConfirm(@Nullable Material type) {
		final ItemStack item = ViewsConfiguration.getViewConfig(VIEW_NAME).getViewItem("confirm");
		if(type != null) item.setType(type);
		return item;
	}

	@Override
	protected ItemStack onDeafultIconOfCountdown(@Nullable Material type) {
		final ItemStack item = ViewsConfiguration.getViewConfig(VIEW_NAME).getViewItem("countdown");
		if(type != null) item.setType(type);
		return item;
	}

	@Override
	protected ItemStack onDeafultIconOfInput(@Nullable Material type, String name, @Nullable List<String> lore) {
		final ItemStack item = ViewsConfiguration.getViewConfig(VIEW_NAME).getViewItem("confirm");
		if(type != null) item.setType(type);
		ViewsConfiguration.setItemMeta(item, name, lore);
		return item;
	}
	
	@Override
	protected String onDefaultTitle() {
		return ViewsConfiguration.getViewConfig(VIEW_NAME).getViewTitle();
	}
}